home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / avi / mcarthur.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-06-11  |  4.3 KB  |  141 lines

  1. VERSION 2.00
  2. Begin Form frmMovie 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "The Movie Program"
  5.    ClientHeight    =   4020
  6.    ClientLeft      =   1845
  7.    ClientTop       =   1605
  8.    ClientWidth     =   3510
  9.    Height          =   4425
  10.    Icon            =   MCARTHUR.FRX:0000
  11.    Left            =   1785
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4020
  14.    ScaleWidth      =   3510
  15.    Top             =   1260
  16.    Width           =   3630
  17.    Begin HScrollBar hsbPosition 
  18.       Height          =   255
  19.       Left            =   0
  20.       TabIndex        =   4
  21.       Top             =   3240
  22.       Width           =   3510
  23.    End
  24.    Begin CommandButton cmdExit 
  25.       Caption         =   "E&xit"
  26.       Height          =   375
  27.       Left            =   2520
  28.       TabIndex        =   3
  29.       Top             =   3600
  30.       Width           =   975
  31.    End
  32.    Begin CheckBox chkSilent 
  33.       Caption         =   "&Silent"
  34.       Height          =   255
  35.       Left            =   1560
  36.       TabIndex        =   2
  37.       Top             =   3600
  38.       Width           =   800
  39.    End
  40.    Begin CheckBox chkAutoRepeat 
  41.       Caption         =   "&Auto Repeat"
  42.       Height          =   255
  43.       Left            =   120
  44.       TabIndex        =   1
  45.       Top             =   3600
  46.       Width           =   1335
  47.    End
  48.    Begin TEGOMM TegommAvi 
  49.       BorderStyle     =   0  'None
  50.       DeviceType      =   ""
  51.       FileName        =   ""
  52.       Height          =   495
  53.       Left            =   0
  54.       pcSpeed         =   100
  55.       pcTaskInterval  =   0
  56.       RecordMode      =   0  'Insert
  57.       Shareable       =   0   'False
  58.       Silent          =   0   'False
  59.       TabIndex        =   0
  60.       Tempo           =   0
  61.       Top             =   2640
  62.       UpdateInterval  =   0
  63.       Width           =   3510
  64.    End
  65. ' Force variables declarations.
  66. Option Explicit
  67. Sub chkSilent_Click ()
  68.     ' If the Silent check box is checked, make the movie
  69.     ' a silent movie.
  70.     If chkSilent.Value = 1 Then
  71.        TegommAvi.Silent = True
  72.     Else
  73.        TegommAvi.Silent = False
  74.     End If
  75. End Sub
  76. Sub cmdExit_Click ()
  77.     End
  78. End Sub
  79. Sub Form_Load ()
  80.     Dim AviFile
  81.      
  82.     ' Set the DeviceType for playback of AVI files.
  83.     TegommAvi.DeviceType = "AVIVideo"
  84.     ' Set the Filename.
  85.     AviFile = Left(APP.Path, 2) + "\MVPROG\AVI\MCARTHUR.AVI"
  86.     TegommAvi.FileName = AviFile
  87.     ' Movie should play inside application's window.
  88.     TegommAvi.hWndDisplay = frmMovie.hWnd
  89.     ' Issue an Open command.
  90.     TegommAvi.Command = "Open"
  91.     ' If Open command failed, display error message.
  92.     If TegommAvi.Error <> 0 Then
  93.        MsgBox "Unable to open " + AviFile, 0, "ERROR"
  94.     End If
  95.     ' Set the Time Format of the multimedia control
  96.     ' to units of frames.
  97.     TegommAvi.TimeFormat = "frames"
  98.     ' Set the minimum value of the scroll bar.
  99.     hsbPosition.Min = 0
  100.     ' Set the maximum value of the scroll bar.
  101.     hsbPosition.Max = TegommAvi.Length
  102.     ' Set the timer interval of the multimedia control
  103.     ' to 100 milliseconds.
  104.     TegommAvi.UpdateInterval = 100
  105. End Sub
  106. Sub Form_Paint ()
  107.     ' Issue a Repaint command to the multimedia control.
  108.     TegommAvi.Command = "Repaint"
  109. End Sub
  110. Sub hsbPosition_Change ()
  111.     ' Change the playback position according to
  112.     ' the scroll bar position, provided that the
  113.     ' multimedia control is either stopped or paused.
  114.     If TegommAvi.Mode = 525 Or TegommAvi.Mode = 529 Then
  115.        TegommAvi.To = hsbPosition.Value
  116.        TegommAvi.Command = "Seek"
  117.     End If
  118. End Sub
  119. Sub hsbPosition_Scroll ()
  120.     ' Call the hsbPosition_Change() procedure.
  121.     hsbPosition_Change
  122. End Sub
  123. Sub TegommAvi_Done ()
  124.     ' Playback reached the end of the file?
  125.     If TegommAvi.Position = TegommAvi.Length Then
  126.        
  127.        ' Rewind the playback position to start of file.
  128.        TegommAvi.Command = "Prev"
  129.        
  130.        ' If Auto Repeat check box is checked, play again.
  131.        If chkAutoRepeat.Value = 1 Then
  132.           TegommAvi.Command = "Play"
  133.        End If
  134.     End If
  135. End Sub
  136. Sub TegommAvi_StatusUpdate ()
  137.     ' Update the scroll bar with the current
  138.     ' playback position.
  139.     hsbPosition.Value = TegommAvi.Position
  140. End Sub
  141.